Giter VIP home page Giter VIP logo

Comments (7)

GameDragon2k avatar GameDragon2k commented on August 15, 2024

Wouldn't changing the directory of the scripts affect the emulators that use these scripts as well?

from raweb.

luchaos avatar luchaos commented on August 15, 2024

i'm sorry, i forgot to explicitly state that as well: on the public side, none of the addresses would be affected - it would all look the same from the outside.
if i understood correctly that is - you mean emulators interfacing with scripts on the site, e.g. by calling http://retroachievements.org/script.php, right?

from raweb.

GameDragon2k avatar GameDragon2k commented on August 15, 2024

Yeah, exactly that.

from raweb.

luchaos avatar luchaos commented on August 15, 2024

what the directory change implies, apart from a cleaner look, is that it will not be possible to simply call any file outside the public directory.

as soon as we start using libraries pulled in by php's dependency manager, those would go into a vendor folder. we would not want to allow anyone to call e.g. http://retroachievements.org/vendor/lib/src/script.php

another advantage is that we can move files to a private location without implementing extra security measures; like secrets in environment configurations, data storage etc - all things that are only meant to be consumed by php but should not be exposed publicly simply by calling the according address.

for example: this should not even be processed http://retroachievements.org/_db_secrets.php but merely result in a 404.

from raweb.

SyrianBallaS avatar SyrianBallaS commented on August 15, 2024

I'm not sure if there is something similar in PHP but in ASP.NET Core there's a concept of "user secrets". How it works is that on the command line, you specify a key/value pair and it stores the secret in a json file (secrets.json) deep in the user folder. It's cross-platform so I'm almost certain it works for Linux and Mac.

Syntax: dotnet user-secrets set <key> <value>

These would be the folders:
Windows: %APPDATA%\microsoft\UserSecrets\<userSecretsId>\secrets.json
Linux: ~/.microsoft/usersecrets/<userSecretsId>/secrets.json
Mac: ~/.microsoft/usersecrets/<userSecretsId>/secrets.json

The "userSecretsID" would be in the project file.

Secrets shouldn't really be in source control anyway. I could probably emulate it using PowerShell Core (cross-platform version of Windows PowerShell).

from raweb.

luchaos avatar luchaos commented on August 15, 2024

that sounds very convenient! there is a comparable way to do this in php - there's a composer package for .env files that reside in the root of the project and are gitignored. there'd be another version controlled .env.example with sensible defaults that can be copied over and adjusted for different environments. i will add this in the upcoming days.

we can have composer act as the main cli tool for the project as well or switch to one of the existing ones out there - i'm currently compiling a list of useful packages that might come in handy in the future. i'll make sure to document all of it as well in case we end up using those.

from raweb.

luchaos avatar luchaos commented on August 15, 2024

All done - that's awesome @ScottFromDerby !
Closing.

from raweb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.