Comments (7)
Wouldn't changing the directory of the scripts affect the emulators that use these scripts as well?
from raweb.
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.
Yeah, exactly that.
from raweb.
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.
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.
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.
All done - that's awesome @ScottFromDerby !
Closing.
from raweb.
Related Issues (20)
- Too Many Requests error when switching pages HOT 4
- Search Results not Yielding all Possible Results
- Games with Special Characters in their Names Won't Show up in Search Results
- Reopened Tickets Still Show "Resolver"
- Games with 5 or less achievements reward a badge HOT 1
- Move Web API to major versioning
- "Other Tickets for this Achievement" not displaying other tickets.
- RR calculation not working when solely softcore earns
- Deptrac: legacy vs other domains HOT 1
- Profile Page "Total Masteries" does not include "hidden games" HOT 3
- Treat banned accounts as non-existing HOT 2
- Inconsistent tooltip tag rendering HOT 3
- Retro Point Calculation Issue HOT 4
- ID field went missing on GetUserSummary API call HOT 1
- Retro Points no longer calculate unearned achievements as if they had 1 earner. HOT 1
- Wrong Comment Info for Schedueled Release
- The "Games" count used on the home page is inaccurate HOT 6
- [Bug Report] Developer site awards stopped updating HOT 1
- Earned points don't always seem to match total calculated by site HOT 4
- Hover-driven tooltips produce a poor user experience on iOS
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raweb.