Giter Club home page Giter Club logo

Comments (4)

asehmi avatar asehmi commented on May 28, 2024

I'm using dotenv which reads the .env file and puts the variables into the app's environment. I think the simplest thing would be to replace these lines in env.py...

ENV_FILE = find_dotenv()
if ENV_FILE:
    load_dotenv(ENV_FILE)

...with a small amount of code that reads the values from .streamlit/secrets.toml and places them into the app's environment. Then the rest of the app should just work. Note, you will create secrets.toml at the time you deploy the app to Streamlit online.

from auth-simple-for-streamlit.

Davis782 avatar Davis782 commented on May 28, 2024

Nice post. Since this last update I believe the Streamlit platform allows for Sharing with a unique URL via Github Repository. Do you have a protocal for using this solution when you have a Googlesheet API where the Key_File must be placed in the secret folder ? Please provide an example if possible.

I was having the current issue with the following......

"Deploy the demo app on "Streamlit Sharing" and use it's "secrets store" instead of my .env solution."

I would love to see how you would approach the above. It appears there is a challenge with pointing a file as per the docs, whereas they show how to push variables, but not files. Please advise. I imagine there is easy pythonic solution to this. Otherwise, I believe your solution would be highly considered.

Regards

from auth-simple-for-streamlit.

asehmi avatar asehmi commented on May 28, 2024

Apart from manually copying and pasting all secrets into the dialog box that pops up when you deploy a Streamlit cloud app and making the changes to load .streamlit/secrets.toml into the running app's environment, I don't know what else to do. In other clouds (Heroku, Azure, AWS, etc.) you'd use a SSH terminal or proprietary CLI tool (for your cloud) to connect to the running container and upload the .env file that way. If you have a secure database, you could use that to store your secrets, but then you need to store your secret DB connection, and you're back to square one! Perhaps you can encrypt the .env file, and store the decryption key in .streamlit/secrets.toml. That way you only need to copy/paste one secret at the time you deploy your Streamlit cloud app. I implemented some encryption/decryption algorithms in this project, so you can use that code to do the job.

Sorry can't be of more help.

from auth-simple-for-streamlit.

Davis782 avatar Davis782 commented on May 28, 2024

from auth-simple-for-streamlit.

Related Issues (5)

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.