commit 3a059172eba626ed6c86116871dc0527de607fce Author: stef Date: Sat Feb 10 15:56:20 2024 +0100 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3aedd0f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +src/autogen/app/tmp/ +src/autogen/app/log/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cd651fe --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM ruby:slim as base + +WORKDIR /usr/src +RUN apt update &&\ + apt install --yes git curl build-essential whois +RUN curl -sL https://deb.nodesource.com/setup_current.x | bash - &&\ + apt-get update && \ + apt-get install --yes --no-install-recommends nodejs &&\ + npm install -g yarn \ + apt-get clean + +RUN gem install rails +# RUN gem install rails + +CMD ["bash"] + + diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..4098a10 --- /dev/null +++ b/README.MD @@ -0,0 +1,215 @@ +# REf +https://www.simplethread.com/how-to-create-a-new-rails-7-app-with-tailwind/ +https://blog.saeloun.com/2021/11/17/rails-7-added-css-app-generator/ + +docker compose up -d +docker compose exec -ti autogen bash + +gem install rails +gem update --system 3.5.6 +rails new autogen --skip-active-record --skip-bundle --css bulma +cd autogen/ +Add to Gemfile : +bundle add mongoid + +change config/mongoid.yaml +```yaml +development: + # Configure available database clients. (required) + clients: + # Defines the default client. (required) + default: + # Mongoid can connect to a URI accepted by the driver: + uri: mongodb://railszen:railszen@mongo:27017/railszen + # Otherwise define the parameters separately. + # This defines the name of the default database that Mongoid can connect to. + # (required). + # database: autodeploy_development + # Provides the hosts the default client can connect to. Must be an array + # of host:port pairs. (required) + # hosts: + # - localhost:27017 + options: + # Note that all options listed below are Ruby driver client options (the mongo gem). + # Please refer to the driver documentation of the version of the mongo gem you are using + # for the most up-to-date list of options. + # + # Change the default write concern. (default = { w: 1 }) + # write: + # w: 1 + + # Change the default read preference. Valid options for mode are: :secondary, + # :secondary_preferred, :primary, :primary_preferred, :nearest + # (default: primary) + # read: + # mode: :secondary_preferred + # tag_sets: + # - use: web + + # The name of the user for authentication. + # user: 'user' + + # The password of the user for authentication. + # password: 'password' + + # The user's database roles. + # roles: + # - 'dbOwner' + + # Change the default authentication mechanism. Valid options are: :scram, + # :mongodb_cr, :mongodb_x509, and :plain. Note that all authentication + # mechanisms require username and password, with the exception of :mongodb_x509. + # Default on mongoDB 3.0 is :scram, default on 2.4 and 2.6 is :plain. + # auth_mech: :scram + + # The database or source to authenticate the user against. + # (default: the database specified above or admin) + # auth_source: admin + + # Force a the driver cluster to behave in a certain manner instead of auto- + # discovering. Can be one of: :direct, :replica_set, :sharded. Set to :direct + # when connecting to hidden members of a replica set. + # connect: :direct + + # Changes the default time in seconds the server monitors refresh their status + # via hello commands. (default: 10) + # heartbeat_frequency: 10 + + # The time in seconds for selecting servers for a near read preference. (default: 0.015) + # local_threshold: 0.015 + + # The timeout in seconds for selecting a server for an operation. (default: 30) + # server_selection_timeout: 30 + + # The maximum number of connections in the connection pool. (default: 5) + # max_pool_size: 5 + + # The minimum number of connections in the connection pool. (default: 1) + # min_pool_size: 1 + + # The time to wait, in seconds, in the connection pool for a connection + # to be checked in before timing out. (default: 5) + # wait_queue_timeout: 5 + + # The time to wait to establish a connection before timing out, in seconds. + # (default: 10) + # connect_timeout: 10 + + # How long to wait for a response for each operation sent to the + # server. This timeout should be set to a value larger than the + # processing time for the longest operation that will be executed + # by the application. Note that this is a client-side timeout; + # the server may continue executing an operation after the client + # aborts it with the SocketTimeout exception. + # (default: nil, meaning no timeout) + # socket_timeout: 5 + + # The name of the replica set to connect to. Servers provided as seeds that do + # not belong to this replica set will be ignored. + # replica_set: name + + # Whether to connect to the servers via ssl. (default: false) + # ssl: true + + # The certificate file used to identify the connection against MongoDB. + # ssl_cert: /path/to/my.cert + + # The private keyfile used to identify the connection against MongoDB. + # Note that even if the key is stored in the same file as the certificate, + # both need to be explicitly specified. + # ssl_key: /path/to/my.key + + # A passphrase for the private key. + # ssl_key_pass_phrase: password + + # Whether to do peer certification validation. (default: true) + # ssl_verify: true + + # The file containing concatenated certificate authority certificates + # used to validate certs passed from the other end of the connection. + # ssl_ca_cert: /path/to/ca.cert + + # Whether to truncate long log lines. (default: true) + # truncate_logs: true + + # Configure Mongoid specific options. (optional) + options: + # Application name that is printed to the mongodb logs upon establishing + # 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 + + # Mark belongs_to associations as required by default, so that saving a + # model with a missing belongs_to association will trigger a validation + # error. (default: true) + # belongs_to_required_by_default: true + + # Raise an exception when a field is redefined. (default: false) + # duplicate_fields_exception: false + + # Include the root model name in json serialization. (default: false) + # include_root_in_json: false + + # Include the _type field in serialization. (default: false) + # include_type_for_serialization: false + + # Whether to join nested persistence contexts for atomic operations + # to parent contexts by default. (default: false) + # join_contexts: false + + # Set the Mongoid and Ruby driver log levels when Mongoid is not using + # Ruby on Rails logger instance. (default: :info) + # log_level: :info + + # Preload all models in development, needed when models use + # inheritance. (default: false) + # preload_models: false + + # Raise an error when performing a #find and the document is not found. + # (default: true) + raise_not_found_error: false + + # Raise an error when defining a scope with the same name as an + # existing method. (default: false) + # scope_overwrite_exception: false + + # 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 + + # Return stored times as UTC. See the time zone section below for + # further information. Most applications should not use this option. + # (default: false) + # use_utc: false + + # (Deprecated) In MongoDB 4.0 and earlier, set whether to create + # indexes in the background by default. (default: false) + # background_indexing: false + +test: + clients: + default: + uri: mongodb://railszen:railszen@mongo:27017/railszen + # database: autodeploy_test + # hosts: + # - localhost:27017 + options: + read: + mode: :primary + max_pool_size: 1 + +``` +bin/rails g mongoid:config +edit config/database.yml and update database info +config/application.rb add config.hosts << "autoinstall.msi.stef.lan" + + +bundle add hotwire-livereload --group development +./bin/rails generate controller Public index --no-helper --no-controller-specs + +bin/rails g scaffold Script name:string stage:string lang:string content:text lock:boolean description:text +bin/rails g scaffold Site name:string domain:string gateway:string nameserver:string network:string netmask:string + +bin/rails s -b 0.0.0.0 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..12d1f29 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,31 @@ +services: + autogen: + container_name: autogen + hostname: autogen + build: . + restart: always + labels: + - "traefik.enable=true" + - "traefik.docker.network=traefik" + - "traefik.http.routers.autoinstall.entrypoints=websecure" + - "traefik.http.routers.autoinstall.tls=true" + - "traefik.http.routers.autoinstall.rule=Host(`autoinstall.msi.stef.lan`)" + - "traefik.http.services.autoinstall.loadbalancer.server.port=3000" + stdin_open: true + tty: true + ports: + - 4000:3000 + + networks: + - traefik + - databases + + volumes: + - ./src:/usr/src +networks: + traefik: + name: traefik + external: true + databases: + name: databases + external: true diff --git a/src/autogen/.dockerignore b/src/autogen/.dockerignore new file mode 100644 index 0000000..9612375 --- /dev/null +++ b/src/autogen/.dockerignore @@ -0,0 +1,37 @@ +# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files. + +# Ignore git directory. +/.git/ + +# Ignore bundler config. +/.bundle + +# Ignore all environment files (except templates). +/.env* +!/.env*.erb + +# 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 diff --git a/src/autogen/.gitattributes b/src/autogen/.gitattributes new file mode 100644 index 0000000..4a66706 --- /dev/null +++ b/src/autogen/.gitattributes @@ -0,0 +1,7 @@ +# See https://git-scm.com/docs/gitattributes for more about git attribute files. + + +# 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/src/autogen/.gitignore b/src/autogen/.gitignore new file mode 100644 index 0000000..5fb66c9 --- /dev/null +++ b/src/autogen/.gitignore @@ -0,0 +1,35 @@ +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile '~/.gitignore_global' + +# Ignore bundler config. +/.bundle + +# Ignore all environment files (except templates). +/.env* +!/.env*.erb + +# 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 + +/public/assets + +# Ignore master key for decrypting credentials and more. +/config/master.key diff --git a/src/autogen/.node-version b/src/autogen/.node-version new file mode 100644 index 0000000..55bb086 --- /dev/null +++ b/src/autogen/.node-version @@ -0,0 +1 @@ +21.6.1 diff --git a/src/autogen/.ruby-version b/src/autogen/.ruby-version new file mode 100644 index 0000000..03463f3 --- /dev/null +++ b/src/autogen/.ruby-version @@ -0,0 +1 @@ +ruby-3.3.0 diff --git a/src/autogen/Dockerfile b/src/autogen/Dockerfile new file mode 100644 index 0000000..b537a1e --- /dev/null +++ b/src/autogen/Dockerfile @@ -0,0 +1,75 @@ +# syntax = docker/dockerfile:1 + +# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile +ARG RUBY_VERSION=3.3.0 +FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base + +# Rails app lives here +WORKDIR /rails + +# Set production environment +ENV RAILS_ENV="production" \ + BUNDLE_DEPLOYMENT="1" \ + BUNDLE_PATH="/usr/local/bundle" \ + BUNDLE_WITHOUT="development" + + +# Throw-away build stage to reduce size of final image +FROM base as build + +# Install packages needed to build gems and node modules +RUN apt-get update -qq && \ + apt-get install --no-install-recommends -y build-essential curl git node-gyp pkg-config python-is-python3 + +# Install JavaScript dependencies +ARG NODE_VERSION=21.6.1 +ARG YARN_VERSION=1.22.21 +ENV PATH=/usr/local/node/bin:$PATH +RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz -C /tmp/ && \ + /tmp/node-build-master/bin/node-build "${NODE_VERSION}" /usr/local/node && \ + npm install -g yarn@$YARN_VERSION && \ + rm -rf /tmp/node-build-master + +# Install application gems +COPY Gemfile Gemfile.lock ./ +RUN bundle install && \ + rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \ + bundle exec bootsnap precompile --gemfile + +# Install node modules +COPY package.json yarn.lock ./ +RUN yarn install --frozen-lockfile + +# Copy application code +COPY . . + +# Precompile bootsnap code for faster boot times +RUN bundle exec bootsnap precompile 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 + +# Install packages needed for deployment +RUN apt-get update -qq && \ + apt-get install --no-install-recommends -y curl && \ + rm -rf /var/lib/apt/lists /var/cache/apt/archives + +# Copy built artifacts: gems, application +COPY --from=build /usr/local/bundle /usr/local/bundle +COPY --from=build /rails /rails + +# Run and own only the runtime files as a non-root user for security +RUN useradd rails --create-home --shell /bin/bash && \ + chown -R rails:rails log tmp +USER rails:rails + +# Entrypoint prepares the database. +ENTRYPOINT ["/rails/bin/docker-entrypoint"] + +# Start the server by default, this can be overwritten at runtime +EXPOSE 3000 +CMD ["./bin/rails", "server"] diff --git a/src/autogen/Gemfile b/src/autogen/Gemfile new file mode 100644 index 0000000..c7ad3d1 --- /dev/null +++ b/src/autogen/Gemfile @@ -0,0 +1,70 @@ +source "https://rubygems.org" + +ruby "3.3.0" + +# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" +gem "rails", "~> 7.1.3" + +# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] +gem "sprockets-rails" + +# 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" + +# Bundle and process CSS [https://github.com/rails/cssbundling-rails] +gem "cssbundling-rails" + +# Build JSON APIs with ease [https://github.com/rails/jbuilder] +gem "jbuilder" + +# Use Redis adapter to run Action Cable in production +# gem "redis", ">= 4.0.1" + +# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] +# gem "kredis" + +# 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 ] + +# Reduces boot times through caching; required in config/boot.rb +gem "bootsnap", require: false + +group :development, :test do + # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem + gem "debug", platforms: %i[ mri windows ] +end + +group :development do + # Use console on exceptions pages [https://github.com/rails/web-console] + gem "web-console" + + # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] + # gem "rack-mini-profiler" + + # Speed up commands on slow machines / big apps [https://github.com/rails/spring] + # gem "spring" +end + +group :test do + # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] + gem "capybara" + gem "selenium-webdriver" +end + +gem "mongoid", "~> 8.1" + +gem "bulma-rails", "~> 0.9.4" + +gem "jquery-rails", "~> 4.6" diff --git a/src/autogen/Gemfile.lock b/src/autogen/Gemfile.lock new file mode 100644 index 0000000..2472ecf --- /dev/null +++ b/src/autogen/Gemfile.lock @@ -0,0 +1,295 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.1.3) + actionpack (= 7.1.3) + activesupport (= 7.1.3) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (7.1.3) + actionpack (= 7.1.3) + activejob (= 7.1.3) + activerecord (= 7.1.3) + activestorage (= 7.1.3) + activesupport (= 7.1.3) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.1.3) + actionpack (= 7.1.3) + actionview (= 7.1.3) + activejob (= 7.1.3) + activesupport (= 7.1.3) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.2) + actionpack (7.1.3) + actionview (= 7.1.3) + activesupport (= 7.1.3) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.3) + actionpack (= 7.1.3) + activerecord (= 7.1.3) + activestorage (= 7.1.3) + activesupport (= 7.1.3) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.1.3) + activesupport (= 7.1.3) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.3) + activesupport (= 7.1.3) + globalid (>= 0.3.6) + activemodel (7.1.3) + activesupport (= 7.1.3) + activerecord (7.1.3) + activemodel (= 7.1.3) + activesupport (= 7.1.3) + timeout (>= 0.4.0) + activestorage (7.1.3) + actionpack (= 7.1.3) + activejob (= 7.1.3) + activerecord (= 7.1.3) + activesupport (= 7.1.3) + marcel (~> 1.0) + activesupport (7.1.3) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) + base64 (0.2.0) + bigdecimal (3.1.6) + bindex (0.8.1) + bootsnap (1.18.3) + msgpack (~> 1.2) + bson (4.15.0) + builder (3.2.4) + bulma-rails (0.9.4) + sassc (~> 2.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.2.3) + connection_pool (2.4.1) + crass (1.0.6) + cssbundling-rails (1.4.0) + railties (>= 6.0.0) + date (3.3.4) + debug (1.9.1) + irb (~> 1.10) + reline (>= 0.3.8) + drb (2.2.0) + ruby2_keywords + erubi (1.12.0) + ffi (1.16.3) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + importmap-rails (2.0.1) + actionpack (>= 6.0.0) + activesupport (>= 6.0.0) + railties (>= 6.0.0) + io-console (0.7.2) + irb (1.11.2) + rdoc + reline (>= 0.4.2) + jbuilder (2.11.5) + actionview (>= 5.0.0) + activesupport (>= 5.0.0) + jquery-rails (4.6.0) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + loofah (2.22.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.2) + matrix (0.4.2) + mini_mime (1.1.5) + minitest (5.22.2) + mongo (2.19.3) + bson (>= 4.14.1, < 5.0.0) + mongoid (8.1.4) + activemodel (>= 5.1, < 7.2, != 7.0.0) + concurrent-ruby (>= 1.0.5, < 2.0) + mongo (>= 2.18.0, < 3.0.0) + ruby2_keywords (~> 0.0.5) + msgpack (1.7.2) + mutex_m (0.2.0) + net-imap (0.4.10) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.4.0.1) + net-protocol + nio4r (2.7.0) + nokogiri (1.16.2-aarch64-linux) + racc (~> 1.4) + nokogiri (1.16.2-arm-linux) + racc (~> 1.4) + nokogiri (1.16.2-arm64-darwin) + racc (~> 1.4) + nokogiri (1.16.2-x86-linux) + racc (~> 1.4) + nokogiri (1.16.2-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.16.2-x86_64-linux) + racc (~> 1.4) + psych (5.1.2) + stringio + public_suffix (5.0.4) + puma (6.4.2) + nio4r (~> 2.0) + racc (1.7.3) + rack (3.0.9) + rack-session (2.0.0) + rack (>= 3.0.0) + rack-test (2.1.0) + rack (>= 1.3) + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) + rails (7.1.3) + actioncable (= 7.1.3) + actionmailbox (= 7.1.3) + actionmailer (= 7.1.3) + actionpack (= 7.1.3) + actiontext (= 7.1.3) + actionview (= 7.1.3) + activejob (= 7.1.3) + activemodel (= 7.1.3) + activerecord (= 7.1.3) + activestorage (= 7.1.3) + activesupport (= 7.1.3) + bundler (>= 1.15.0) + railties (= 7.1.3) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.1.3) + actionpack (= 7.1.3) + activesupport (= 7.1.3) + irb + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rake (13.1.0) + rdoc (6.6.2) + psych (>= 4.0.0) + regexp_parser (2.9.0) + reline (0.4.2) + io-console (~> 0.5) + rexml (3.2.6) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) + sassc (2.4.0) + ffi (~> 1.9) + selenium-webdriver (4.17.0) + base64 (~> 0.2) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) + sprockets (4.2.1) + concurrent-ruby (~> 1.0) + rack (>= 2.2.4, < 4) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + sprockets (>= 3.0.0) + stimulus-rails (1.3.3) + railties (>= 6.0.0) + stringio (3.1.0) + thor (1.3.0) + timeout (0.4.1) + turbo-rails (2.0.2) + actionpack (>= 6.0.0) + activejob (>= 6.0.0) + railties (>= 6.0.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + web-console (4.2.1) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) + bindex (>= 0.4.0) + railties (>= 6.0.0) + webrick (1.8.1) + websocket (1.2.10) + websocket-driver (0.7.6) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.6.13) + +PLATFORMS + aarch64-linux + arm-linux + arm64-darwin + x86-linux + x86_64-darwin + x86_64-linux + +DEPENDENCIES + bootsnap + bulma-rails (~> 0.9.4) + capybara + cssbundling-rails + debug + importmap-rails + jbuilder + jquery-rails (~> 4.6) + mongoid (~> 8.1) + puma (>= 5.0) + rails (~> 7.1.3) + selenium-webdriver + sprockets-rails + stimulus-rails + turbo-rails + tzinfo-data + web-console + +RUBY VERSION + ruby 3.3.0p0 + +BUNDLED WITH + 2.5.3 diff --git a/src/autogen/README.md b/src/autogen/README.md new file mode 100644 index 0000000..7db80e4 --- /dev/null +++ b/src/autogen/README.md @@ -0,0 +1,24 @@ +# README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... diff --git a/src/autogen/Rakefile b/src/autogen/Rakefile new file mode 100644 index 0000000..9a5ea73 --- /dev/null +++ b/src/autogen/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/src/autogen/app/assets/config/manifest.js b/src/autogen/app/assets/config/manifest.js new file mode 100644 index 0000000..8472229 --- /dev/null +++ b/src/autogen/app/assets/config/manifest.js @@ -0,0 +1,3 @@ +//= link_tree ../images .png +//= link_directory ../stylesheets .css +//= link_tree ../javascript .js \ No newline at end of file diff --git a/src/autogen/app/assets/images/.keep b/src/autogen/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/app/assets/images/installerlogo.png b/src/autogen/app/assets/images/installerlogo.png new file mode 100644 index 0000000..b46c196 Binary files /dev/null and b/src/autogen/app/assets/images/installerlogo.png differ diff --git a/src/autogen/app/assets/javascript/init.js b/src/autogen/app/assets/javascript/init.js new file mode 100644 index 0000000..283de1b --- /dev/null +++ b/src/autogen/app/assets/javascript/init.js @@ -0,0 +1,7 @@ +$( document ).ready(function() { + $('.toggleable').next().hide(); + $(document).on("click",".toggleable", function(){ + $(this).toggleClass("is-active"); + $(this).next().toggle(); + }); +}) \ No newline at end of file diff --git a/src/autogen/app/assets/javascript/jquery-3.7.1.min.js b/src/autogen/app/assets/javascript/jquery-3.7.1.min.js new file mode 100644 index 0000000..7f37b5d --- /dev/null +++ b/src/autogen/app/assets/javascript/jquery-3.7.1.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="",le.option=!!xe.lastChild;var ke={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="
",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 0 +
+

Home#index

+
+

Find me in app/views/home/index.html.erb

+ \ No newline at end of file diff --git a/src/autogen/app/views/layouts/application.html.erb b/src/autogen/app/views/layouts/application.html.erb new file mode 100644 index 0000000..124e8e9 --- /dev/null +++ b/src/autogen/app/views/layouts/application.html.erb @@ -0,0 +1,31 @@ + + + + Autogen + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> + <%= javascript_include_tag "jquery-3.7.1.min" %> + + + + +
+ <%= render "partials/top-menu" %> +
+
+ <%= render "partials/left-menu" %> +
+
+ +
+ <%= yield %> +
+
+
+
+ <%= javascript_include_tag "init" %> + + diff --git a/src/autogen/app/views/layouts/mailer.html.erb b/src/autogen/app/views/layouts/mailer.html.erb new file mode 100644 index 0000000..3aac900 --- /dev/null +++ b/src/autogen/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/src/autogen/app/views/layouts/mailer.text.erb b/src/autogen/app/views/layouts/mailer.text.erb new file mode 100644 index 0000000..37f0bdd --- /dev/null +++ b/src/autogen/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/src/autogen/app/views/partials/_left-menu.html.erb b/src/autogen/app/views/partials/_left-menu.html.erb new file mode 100644 index 0000000..53c7b54 --- /dev/null +++ b/src/autogen/app/views/partials/_left-menu.html.erb @@ -0,0 +1,40 @@ + \ No newline at end of file diff --git a/src/autogen/app/views/partials/_top-menu.html.erb b/src/autogen/app/views/partials/_top-menu.html.erb new file mode 100644 index 0000000..eab3aef --- /dev/null +++ b/src/autogen/app/views/partials/_top-menu.html.erb @@ -0,0 +1,60 @@ + \ No newline at end of file diff --git a/src/autogen/app/views/scripts/_form.html.erb b/src/autogen/app/views/scripts/_form.html.erb new file mode 100644 index 0000000..c5cfa20 --- /dev/null +++ b/src/autogen/app/views/scripts/_form.html.erb @@ -0,0 +1,47 @@ +<%= form_with(model: script) do |form| %> + <% if script.errors.any? %> +
+

<%= pluralize(script.errors.count, "error") %> prohibited this script from being saved:

+ +
    + <% script.errors.each do |error| %> +
  • <%= error.full_message %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= form.label :name, style: "display: block" %> + <%= form.text_field :name %> +
+ +
+ <%= form.label :stage, style: "display: block" %> + <%= form.text_field :stage %> +
+ +
+ <%= form.label :lang, style: "display: block" %> + <%= form.text_field :lang %> +
+ +
+ <%= form.label :content, style: "display: block" %> + <%= form.text_area :content %> +
+ +
+ <%= form.label :lock, style: "display: block" %> + <%= form.check_box :lock %> +
+ +
+ <%= form.label :description, style: "display: block" %> + <%= form.text_area :description %> +
+ +
+ <%= form.submit %> +
+<% end %> diff --git a/src/autogen/app/views/scripts/_script.html.erb b/src/autogen/app/views/scripts/_script.html.erb new file mode 100644 index 0000000..4e11b1a --- /dev/null +++ b/src/autogen/app/views/scripts/_script.html.erb @@ -0,0 +1,32 @@ +
+

+ Name: + <%= script.name %> +

+ +

+ Stage: + <%= script.stage %> +

+ +

+ Lang: + <%= script.lang %> +

+ +

+ Content: + <%= script.content %> +

+ +

+ Lock: + <%= script.lock %> +

+ +

+ Description: + <%= script.description %> +

+ +
diff --git a/src/autogen/app/views/scripts/_script.json.jbuilder b/src/autogen/app/views/scripts/_script.json.jbuilder new file mode 100644 index 0000000..4483f68 --- /dev/null +++ b/src/autogen/app/views/scripts/_script.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! script, :id, :name, :stage, :lang, :content, :lock, :description, :created_at, :updated_at +json.url script_url(script, format: :json) diff --git a/src/autogen/app/views/scripts/edit.html.erb b/src/autogen/app/views/scripts/edit.html.erb new file mode 100644 index 0000000..8295999 --- /dev/null +++ b/src/autogen/app/views/scripts/edit.html.erb @@ -0,0 +1,10 @@ +

Editing script

+ +<%= render "form", script: @script %> + +
+ +
+ <%= link_to "Show this script", @script %> | + <%= link_to "Back to scripts", scripts_path %> +
diff --git a/src/autogen/app/views/scripts/index.html.erb b/src/autogen/app/views/scripts/index.html.erb new file mode 100644 index 0000000..5490a24 --- /dev/null +++ b/src/autogen/app/views/scripts/index.html.erb @@ -0,0 +1,14 @@ +

<%= notice %>

+ +

Scripts

+ +
+ <% @scripts.each do |script| %> + <%= render script %> +

+ <%= link_to "Show this script", script %> +

+ <% end %> +
+ +<%= link_to "New script", new_script_path %> diff --git a/src/autogen/app/views/scripts/index.json.jbuilder b/src/autogen/app/views/scripts/index.json.jbuilder new file mode 100644 index 0000000..6c42ed4 --- /dev/null +++ b/src/autogen/app/views/scripts/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @scripts, partial: "scripts/script", as: :script diff --git a/src/autogen/app/views/scripts/new.html.erb b/src/autogen/app/views/scripts/new.html.erb new file mode 100644 index 0000000..f074f1a --- /dev/null +++ b/src/autogen/app/views/scripts/new.html.erb @@ -0,0 +1,9 @@ +

New script

+ +<%= render "form", script: @script %> + +
+ +
+ <%= link_to "Back to scripts", scripts_path %> +
diff --git a/src/autogen/app/views/scripts/show.html.erb b/src/autogen/app/views/scripts/show.html.erb new file mode 100644 index 0000000..10af54d --- /dev/null +++ b/src/autogen/app/views/scripts/show.html.erb @@ -0,0 +1,10 @@ +

<%= notice %>

+ +<%= render @script %> + +
+ <%= link_to "Edit this script", edit_script_path(@script) %> | + <%= link_to "Back to scripts", scripts_path %> + + <%= button_to "Destroy this script", @script, method: :delete %> +
diff --git a/src/autogen/app/views/scripts/show.json.jbuilder b/src/autogen/app/views/scripts/show.json.jbuilder new file mode 100644 index 0000000..1b8efd7 --- /dev/null +++ b/src/autogen/app/views/scripts/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "scripts/script", script: @script diff --git a/src/autogen/bin/docker-entrypoint b/src/autogen/bin/docker-entrypoint new file mode 100755 index 0000000..de0b30b --- /dev/null +++ b/src/autogen/bin/docker-entrypoint @@ -0,0 +1,3 @@ +#!/bin/bash -e + +exec "${@}" diff --git a/src/autogen/bin/rails b/src/autogen/bin/rails new file mode 100755 index 0000000..efc0377 --- /dev/null +++ b/src/autogen/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/src/autogen/bin/rake b/src/autogen/bin/rake new file mode 100755 index 0000000..4fbf10b --- /dev/null +++ b/src/autogen/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "rake" +Rake.application.run diff --git a/src/autogen/bin/setup b/src/autogen/bin/setup new file mode 100755 index 0000000..a627cd9 --- /dev/null +++ b/src/autogen/bin/setup @@ -0,0 +1,28 @@ +#!/usr/bin/env ruby +require "fileutils" + +# path to your application root. +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! "gem install bundler --conservative" + system("bundle check") || system!("bundle install") + + # Install JavaScript dependencies + system("yarn check --check-files") || system!("yarn install") + + puts "\n== Removing old logs and tempfiles ==" + system! "bin/rails log:clear tmp:clear" + + puts "\n== Restarting application server ==" + system! "bin/rails restart" +end diff --git a/src/autogen/config.ru b/src/autogen/config.ru new file mode 100644 index 0000000..4a3c09a --- /dev/null +++ b/src/autogen/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/src/autogen/config/application.rb b/src/autogen/config/application.rb new file mode 100644 index 0000000..9d4b3d8 --- /dev/null +++ b/src/autogen/config/application.rb @@ -0,0 +1,40 @@ +require_relative "boot" + +require "rails" +# Pick the frameworks you want: +require "active_model/railtie" +require "active_job/railtie" +# require "active_record/railtie" +# require "active_storage/engine" +require "action_controller/railtie" +require "action_mailer/railtie" +# require "action_mailbox/engine" +# require "action_text/engine" +require "action_view/railtie" +require "action_cable/engine" +require "rails/test_unit/railtie" + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module Autogen + class Application < Rails::Application + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 7.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") + config.hosts << "autoinstall.msi.stef.lan" + end +end diff --git a/src/autogen/config/boot.rb b/src/autogen/config/boot.rb new file mode 100644 index 0000000..988a5dd --- /dev/null +++ b/src/autogen/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/src/autogen/config/cable.yml b/src/autogen/config/cable.yml new file mode 100644 index 0000000..6ce475e --- /dev/null +++ b/src/autogen/config/cable.yml @@ -0,0 +1,10 @@ +development: + adapter: async + +test: + adapter: test + +production: + adapter: redis + url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + channel_prefix: autogen_production diff --git a/src/autogen/config/credentials.yml.enc b/src/autogen/config/credentials.yml.enc new file mode 100644 index 0000000..b559ad2 --- /dev/null +++ b/src/autogen/config/credentials.yml.enc @@ -0,0 +1 @@ +Pu7UsIECoqYcIGNuzbxA0Jk148K5ixxvy/CcBUOKWjcHhLKnkZesYbIkPQ+/tBlu+2vYtVivpCLEieCSPNyFG5eRErgXuZUGjm4bajzfflR2rrujd54F3+rPGCo8aFD7PIUEeK7IGgVIfwtOIPfbOoul/5eXthbqkfT8Jx6AmwbizhnPacSL2zsBNoSquTEwE4LXFg7zT4UQXBE8WRrCsJkTRJHV6/2oOJl0fxeJIVgoU5DIG47m7haEjR4Me7l5HPZUFpnQktZ3xKypMBA6DaMg8IAP4KQfmlZ9WXNdpb6p8yhuF4ssow3j8U7fQM7DddRG8plLQv6BKu9BIdASw8vi85cD3dm2CbMozC2coTzYfL68vp31OcogCW7ZMWlg1NZKq1V3YeZowbsAiaD3KtzU9z9b--S3olxmjIJNRe1fsE--UHStYIhSHH/X1a39+VSxqg== \ No newline at end of file diff --git a/src/autogen/config/environment.rb b/src/autogen/config/environment.rb new file mode 100644 index 0000000..cac5315 --- /dev/null +++ b/src/autogen/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative "application" + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/src/autogen/config/environments/development.rb b/src/autogen/config/environments/development.rb new file mode 100644 index 0000000..a695867 --- /dev/null +++ b/src/autogen/config/environments/development.rb @@ -0,0 +1,67 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded any time + # it changes. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + 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 caching. By default caching is disabled. + # Run rails dev:cache to toggle 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.cache_store = :memory_store + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=#{2.days.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + config.action_mailer.perform_caching = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Highlight code that enqueued background job in logs. + config.active_job.verbose_enqueue_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 +end diff --git a/src/autogen/config/environments/production.rb b/src/autogen/config/environments/production.rb new file mode 100644 index 0000000..2d97372 --- /dev/null +++ b/src/autogen/config/environments/production.rb @@ -0,0 +1,91 @@ +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. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment + # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files). + # config.require_master_key = true + + # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. + # config.public_file_server.enabled = false + + # Compress CSS using a preprocessor. + # config.assets.css_compressor = :sass + + # Do not fall back to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.asset_host = "http://assets.example.com" + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache + # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX + + # Mount Action Cable outside main process or domain. + # config.action_cable.mount_path = nil + # config.action_cable.url = "wss://example.com/cable" + # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] + + # Assume all access to the app is happening through a SSL-terminating reverse proxy. + # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies. + # config.assume_ssl = true + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + config.force_ssl = true + + # Log to STDOUT by default + config.logger = ActiveSupport::Logger.new(STDOUT) + .tap { |logger| logger.formatter = ::Logger::Formatter.new } + .then { |logger| ActiveSupport::TaggedLogging.new(logger) } + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # "info" includes generic and useful information about system operation, but avoids logging too much + # information to avoid inadvertent exposure of personally identifiable information (PII). If you + # want to log everything, set the level to "debug". + config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment). + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = "autogen_production" + + config.action_mailer.perform_caching = false + + # 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 + + # 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 + + # Don't log any deprecations. + config.active_support.report_deprecations = false + + # 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/src/autogen/config/environments/test.rb b/src/autogen/config/environments/test.rb new file mode 100644 index 0000000..c468e29 --- /dev/null +++ b/src/autogen/config/environments/test.rb @@ -0,0 +1,61 @@ +require "active_support/core_ext/integer/time" + +# 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.enabled = true + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=#{1.hour.to_i}" + } + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + 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 + + config.action_mailer.perform_caching = false + + # 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 + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # 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/src/autogen/config/initializers/assets.rb b/src/autogen/config/initializers/assets.rb new file mode 100644 index 0000000..2eeef96 --- /dev/null +++ b/src/autogen/config/initializers/assets.rb @@ -0,0 +1,12 @@ +# 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 + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in the app/assets +# folder are already added. +# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/src/autogen/config/initializers/content_security_policy.rb b/src/autogen/config/initializers/content_security_policy.rb new file mode 100644 index 0000000..b3076b3 --- /dev/null +++ b/src/autogen/config/initializers/content_security_policy.rb @@ -0,0 +1,25 @@ +# 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) +# +# # Report violations without enforcing the policy. +# # config.content_security_policy_report_only = true +# end diff --git a/src/autogen/config/initializers/filter_parameter_logging.rb b/src/autogen/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..c2d89e2 --- /dev/null +++ b/src/autogen/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, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn +] diff --git a/src/autogen/config/initializers/inflections.rb b/src/autogen/config/initializers/inflections.rb new file mode 100644 index 0000000..3860f65 --- /dev/null +++ b/src/autogen/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/src/autogen/config/initializers/permissions_policy.rb b/src/autogen/config/initializers/permissions_policy.rb new file mode 100644 index 0000000..7db3b95 --- /dev/null +++ b/src/autogen/config/initializers/permissions_policy.rb @@ -0,0 +1,13 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide HTTP permissions policy. For further +# information see: https://developers.google.com/web/updates/2018/06/feature-policy + +# Rails.application.config.permissions_policy do |policy| +# policy.camera :none +# policy.gyroscope :none +# policy.microphone :none +# policy.usb :none +# policy.fullscreen :self +# policy.payment :self, "https://secure.example.com" +# end diff --git a/src/autogen/config/locales/en.yml b/src/autogen/config/locales/en.yml new file mode 100644 index 0000000..6c349ae --- /dev/null +++ b/src/autogen/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/src/autogen/config/mongoid.yml b/src/autogen/config/mongoid.yml new file mode 100644 index 0000000..3362a0c --- /dev/null +++ b/src/autogen/config/mongoid.yml @@ -0,0 +1,185 @@ +development: + # Configure available database clients. (required) + clients: + # Defines the default client. (required) + default: + # Mongoid can connect to a URI accepted by the driver: + uri: mongodb://railszen:railszen@mongo:27017/railszen + # Otherwise define the parameters separately. + # This defines the name of the default database that Mongoid can connect to. + # (required). + # database: autodeploy_development + # Provides the hosts the default client can connect to. Must be an array + # of host:port pairs. (required) + # hosts: + # - localhost:27017 + options: + # Note that all options listed below are Ruby driver client options (the mongo gem). + # Please refer to the driver documentation of the version of the mongo gem you are using + # for the most up-to-date list of options. + # + # Change the default write concern. (default = { w: 1 }) + # write: + # w: 1 + + # Change the default read preference. Valid options for mode are: :secondary, + # :secondary_preferred, :primary, :primary_preferred, :nearest + # (default: primary) + # read: + # mode: :secondary_preferred + # tag_sets: + # - use: web + + # The name of the user for authentication. + # user: 'user' + + # The password of the user for authentication. + # password: 'password' + + # The user's database roles. + # roles: + # - 'dbOwner' + + # Change the default authentication mechanism. Valid options are: :scram, + # :mongodb_cr, :mongodb_x509, and :plain. Note that all authentication + # mechanisms require username and password, with the exception of :mongodb_x509. + # Default on mongoDB 3.0 is :scram, default on 2.4 and 2.6 is :plain. + # auth_mech: :scram + + # The database or source to authenticate the user against. + # (default: the database specified above or admin) + # auth_source: admin + + # Force a the driver cluster to behave in a certain manner instead of auto- + # discovering. Can be one of: :direct, :replica_set, :sharded. Set to :direct + # when connecting to hidden members of a replica set. + # connect: :direct + + # Changes the default time in seconds the server monitors refresh their status + # via hello commands. (default: 10) + # heartbeat_frequency: 10 + + # The time in seconds for selecting servers for a near read preference. (default: 0.015) + # local_threshold: 0.015 + + # The timeout in seconds for selecting a server for an operation. (default: 30) + # server_selection_timeout: 30 + + # The maximum number of connections in the connection pool. (default: 5) + # max_pool_size: 5 + + # The minimum number of connections in the connection pool. (default: 1) + # min_pool_size: 1 + + # The time to wait, in seconds, in the connection pool for a connection + # to be checked in before timing out. (default: 5) + # wait_queue_timeout: 5 + + # The time to wait to establish a connection before timing out, in seconds. + # (default: 10) + # connect_timeout: 10 + + # How long to wait for a response for each operation sent to the + # server. This timeout should be set to a value larger than the + # processing time for the longest operation that will be executed + # by the application. Note that this is a client-side timeout; + # the server may continue executing an operation after the client + # aborts it with the SocketTimeout exception. + # (default: nil, meaning no timeout) + # socket_timeout: 5 + + # The name of the replica set to connect to. Servers provided as seeds that do + # not belong to this replica set will be ignored. + # replica_set: name + + # Whether to connect to the servers via ssl. (default: false) + # ssl: true + + # The certificate file used to identify the connection against MongoDB. + # ssl_cert: /path/to/my.cert + + # The private keyfile used to identify the connection against MongoDB. + # Note that even if the key is stored in the same file as the certificate, + # both need to be explicitly specified. + # ssl_key: /path/to/my.key + + # A passphrase for the private key. + # ssl_key_pass_phrase: password + + # Whether to do peer certification validation. (default: true) + # ssl_verify: true + + # The file containing concatenated certificate authority certificates + # used to validate certs passed from the other end of the connection. + # ssl_ca_cert: /path/to/ca.cert + + # Whether to truncate long log lines. (default: true) + # truncate_logs: true + + # Configure Mongoid specific options. (optional) + options: + # Application name that is printed to the mongodb logs upon establishing + # 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 + + # Mark belongs_to associations as required by default, so that saving a + # model with a missing belongs_to association will trigger a validation + # error. (default: true) + # belongs_to_required_by_default: true + + # Raise an exception when a field is redefined. (default: false) + # duplicate_fields_exception: false + + # Include the root model name in json serialization. (default: false) + # include_root_in_json: false + + # Include the _type field in serialization. (default: false) + # include_type_for_serialization: false + + # Whether to join nested persistence contexts for atomic operations + # to parent contexts by default. (default: false) + # join_contexts: false + + # Set the Mongoid and Ruby driver log levels when Mongoid is not using + # Ruby on Rails logger instance. (default: :info) + # log_level: :info + + # Preload all models in development, needed when models use + # inheritance. (default: false) + # preload_models: false + + # Raise an error when performing a #find and the document is not found. + # (default: true) + raise_not_found_error: false + + # Raise an error when defining a scope with the same name as an + # existing method. (default: false) + # scope_overwrite_exception: false + + # 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 + + # Return stored times as UTC. See the time zone section below for + # further information. Most applications should not use this option. + # (default: false) + # use_utc: false + + # (Deprecated) In MongoDB 4.0 and earlier, set whether to create + # indexes in the background by default. (default: false) + # background_indexing: false + +test: + clients: + default: + uri: mongodb://railszen:railszen@mongo:27017/railszen + # database: autodeploy_test + # hosts: + # - localhost:27017 + options: + read: + mode: :primary + max_pool_size: 1 \ No newline at end of file diff --git a/src/autogen/config/puma.rb b/src/autogen/config/puma.rb new file mode 100644 index 0000000..afa809b --- /dev/null +++ b/src/autogen/config/puma.rb @@ -0,0 +1,35 @@ +# 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 can serve each request in a thread from an internal thread pool. +# The `threads` method setting takes two numbers: a minimum and maximum. +# Any libraries that use thread pools should be configured to match +# the maximum value specified for Puma. Default is set to 5 threads for minimum +# and maximum; this matches the default thread size of Active Record. +max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } +threads min_threads_count, max_threads_count + +# Specifies that the worker count should equal the number of processors in production. +if ENV["RAILS_ENV"] == "production" + require "concurrent-ruby" + worker_count = Integer(ENV.fetch("WEB_CONCURRENCY") { Concurrent.physical_processor_count }) + workers worker_count if worker_count > 1 +end + +# Specifies the `worker_timeout` threshold that Puma will use to wait before +# terminating a worker in development environments. +worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +port ENV.fetch("PORT") { 3000 } + +# Specifies the `environment` that Puma will run in. +environment ENV.fetch("RAILS_ENV") { "development" } + +# Specifies the `pidfile` that Puma will use. +pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } + +# Allow puma to be restarted by `bin/rails restart` command. +plugin :tmp_restart diff --git a/src/autogen/config/routes.rb b/src/autogen/config/routes.rb new file mode 100644 index 0000000..87a79c1 --- /dev/null +++ b/src/autogen/config/routes.rb @@ -0,0 +1,12 @@ +Rails.application.routes.draw do + resources :scripts + root 'home#index' + # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html + + # 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 + + # Defines the root path route ("/") + # root "posts#index" +end diff --git a/src/autogen/lib/assets/.keep b/src/autogen/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/lib/tasks/.keep b/src/autogen/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/log/.keep b/src/autogen/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/public/404.html b/src/autogen/public/404.html new file mode 100644 index 0000000..2be3af2 --- /dev/null +++ b/src/autogen/public/404.html @@ -0,0 +1,67 @@ + + + + The page you were looking for doesn't exist (404) + + + + + + +
+
+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/src/autogen/public/422.html b/src/autogen/public/422.html new file mode 100644 index 0000000..c08eac0 --- /dev/null +++ b/src/autogen/public/422.html @@ -0,0 +1,67 @@ + + + + The change you wanted was rejected (422) + + + + + + +
+
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/src/autogen/public/500.html b/src/autogen/public/500.html new file mode 100644 index 0000000..78a030a --- /dev/null +++ b/src/autogen/public/500.html @@ -0,0 +1,66 @@ + + + + We're sorry, but something went wrong (500) + + + + + + +
+
+

We're sorry, but something went wrong.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/src/autogen/public/apple-touch-icon-precomposed.png b/src/autogen/public/apple-touch-icon-precomposed.png new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/public/apple-touch-icon.png b/src/autogen/public/apple-touch-icon.png new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/public/favicon.ico b/src/autogen/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/public/robots.txt b/src/autogen/public/robots.txt new file mode 100644 index 0000000..c19f78a --- /dev/null +++ b/src/autogen/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/src/autogen/storage/.keep b/src/autogen/storage/.keep new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/test/application_system_test_case.rb b/src/autogen/test/application_system_test_case.rb new file mode 100644 index 0000000..d19212a --- /dev/null +++ b/src/autogen/test/application_system_test_case.rb @@ -0,0 +1,5 @@ +require "test_helper" + +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase + driven_by :selenium, using: :chrome, screen_size: [1400, 1400] +end diff --git a/src/autogen/test/channels/application_cable/connection_test.rb b/src/autogen/test/channels/application_cable/connection_test.rb new file mode 100644 index 0000000..6340bf9 --- /dev/null +++ b/src/autogen/test/channels/application_cable/connection_test.rb @@ -0,0 +1,13 @@ +require "test_helper" + +module ApplicationCable + class ConnectionTest < ActionCable::Connection::TestCase + # test "connects with cookies" do + # cookies.signed[:user_id] = 42 + # + # connect + # + # assert_equal connection.user_id, "42" + # end + end +end diff --git a/src/autogen/test/controllers/.keep b/src/autogen/test/controllers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/test/controllers/home_controller_test.rb b/src/autogen/test/controllers/home_controller_test.rb new file mode 100644 index 0000000..f6f3785 --- /dev/null +++ b/src/autogen/test/controllers/home_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class HomeControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get home_index_url + assert_response :success + end +end diff --git a/src/autogen/test/controllers/scripts_controller_test.rb b/src/autogen/test/controllers/scripts_controller_test.rb new file mode 100644 index 0000000..fe89ff1 --- /dev/null +++ b/src/autogen/test/controllers/scripts_controller_test.rb @@ -0,0 +1,48 @@ +require "test_helper" + +class ScriptsControllerTest < ActionDispatch::IntegrationTest + setup do + @script = scripts(:one) + end + + test "should get index" do + get scripts_url + assert_response :success + end + + test "should get new" do + get new_script_url + assert_response :success + end + + test "should create script" do + assert_difference("Script.count") do + post scripts_url, params: { script: { content: @script.content, description: @script.description, lang: @script.lang, lock: @script.lock, name: @script.name, stage: @script.stage } } + end + + assert_redirected_to script_url(Script.last) + end + + test "should show script" do + get script_url(@script) + assert_response :success + end + + test "should get edit" do + get edit_script_url(@script) + assert_response :success + end + + test "should update script" do + patch script_url(@script), params: { script: { content: @script.content, description: @script.description, lang: @script.lang, lock: @script.lock, name: @script.name, stage: @script.stage } } + assert_redirected_to script_url(@script) + end + + test "should destroy script" do + assert_difference("Script.count", -1) do + delete script_url(@script) + end + + assert_redirected_to scripts_url + end +end diff --git a/src/autogen/test/fixtures/files/.keep b/src/autogen/test/fixtures/files/.keep new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/test/fixtures/scripts.yml b/src/autogen/test/fixtures/scripts.yml new file mode 100644 index 0000000..84b56a2 --- /dev/null +++ b/src/autogen/test/fixtures/scripts.yml @@ -0,0 +1,17 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + stage: MyString + lang: MyString + content: MyText + lock: false + description: MyText + +two: + name: MyString + stage: MyString + lang: MyString + content: MyText + lock: false + description: MyText diff --git a/src/autogen/test/helpers/.keep b/src/autogen/test/helpers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/test/integration/.keep b/src/autogen/test/integration/.keep new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/test/mailers/.keep b/src/autogen/test/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/test/models/.keep b/src/autogen/test/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/test/models/script_test.rb b/src/autogen/test/models/script_test.rb new file mode 100644 index 0000000..dacb96b --- /dev/null +++ b/src/autogen/test/models/script_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class ScriptTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/src/autogen/test/system/.keep b/src/autogen/test/system/.keep new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/test/system/scripts_test.rb b/src/autogen/test/system/scripts_test.rb new file mode 100644 index 0000000..9e4e472 --- /dev/null +++ b/src/autogen/test/system/scripts_test.rb @@ -0,0 +1,51 @@ +require "application_system_test_case" + +class ScriptsTest < ApplicationSystemTestCase + setup do + @script = scripts(:one) + end + + test "visiting the index" do + visit scripts_url + assert_selector "h1", text: "Scripts" + end + + test "should create script" do + visit scripts_url + click_on "New script" + + fill_in "Content", with: @script.content + fill_in "Description", with: @script.description + fill_in "Lang", with: @script.lang + check "Lock" if @script.lock + fill_in "Name", with: @script.name + fill_in "Stage", with: @script.stage + click_on "Create Script" + + assert_text "Script was successfully created" + click_on "Back" + end + + test "should update Script" do + visit script_url(@script) + click_on "Edit this script", match: :first + + fill_in "Content", with: @script.content + fill_in "Description", with: @script.description + fill_in "Lang", with: @script.lang + check "Lock" if @script.lock + fill_in "Name", with: @script.name + fill_in "Stage", with: @script.stage + click_on "Update Script" + + assert_text "Script was successfully updated" + click_on "Back" + end + + test "should destroy Script" do + visit script_url(@script) + click_on "Destroy this script", match: :first + + assert_text "Script was successfully destroyed" + end +end diff --git a/src/autogen/test/test_helper.rb b/src/autogen/test/test_helper.rb new file mode 100644 index 0000000..c3cf780 --- /dev/null +++ b/src/autogen/test/test_helper.rb @@ -0,0 +1,12 @@ +ENV["RAILS_ENV"] ||= "test" +require_relative "../config/environment" +require "rails/test_help" + +module ActiveSupport + class TestCase + # Run tests in parallel with specified workers + parallelize(workers: :number_of_processors) + + # Add more helper methods to be used by all tests here... + end +end diff --git a/src/autogen/tmp/.keep b/src/autogen/tmp/.keep new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/tmp/pids/.keep b/src/autogen/tmp/pids/.keep new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/tmp/storage/.keep b/src/autogen/tmp/storage/.keep new file mode 100644 index 0000000..e69de29 diff --git a/src/autogen/vendor/.keep b/src/autogen/vendor/.keep new file mode 100644 index 0000000..e69de29