Giter VIP home page Giter VIP logo

Comments (3)

matt-fidd avatar matt-fidd commented on September 18, 2024 2

Ah sorry! Slipped my mind that this was in actual not actual-server. Generating the file for the server on start is a great idea and would sort that out though!

actual gets its version information directly from package.json, but generating the same file on start and reading from it should do the trick? I'm going to have to think a bit about how builds work and how it would work bundled into actual-server. Maybe if the file isn't there we know it's been imported not directly started and we can fallback to the version in package.json. It wouldn't work for edge builds of actual packaged into actual-server though.

from actual.

matt-fidd avatar matt-fidd commented on September 18, 2024

I took a stab at this as one of my first potential changes to actual.

I could either do it through express-actuator (already used for /info /health and /metrics) but it required a git.properties file be generated for every commit and I'm not sure how practical that is.

Alternatively I made a /info/git endpoint that did

execSync('git rev-parse HEAD', { cwd: config.projectRoot }).toString().trim();

Are we okay with exec calls?

from actual.

MatissJanis avatar MatissJanis commented on September 18, 2024

For actual-server: ideally I wouldn't want to have usage of exec within the codebase. It can potentially lead to arbitrary code execution down the line (all it takes is for a junior to come in and add a variable in the shell command.. and 💣). What if we created a new file when running yarn start that wrote a new file with active commit hash? And then just read from that file to get the hash. Same thing could be applied for yarn build.

For actual: the hash here would be different. No quick ideas how to solve it.

from actual.

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.