Comments (5)
Yeah I actually have wanted a setting for that for a while. Basically something to use instead of priv
.
Problem is, that it makes impossible to install release on immutable location(at least for a location themself), and configure the whole application to have it mutable data on another storage.
I'm not sure I understand what you mean by this. If data does not already exist, Tzdata will attempt to download it. Alternatively developers/admins can copy the existing .ets
file to the defined dir before starting the app. Tzdata looks for the newest ets
file and uses that.
from tzdata.
Sorry, if it was not understandable, I'll try to explain it in more details, the whole problem and confusion.
I'll try to show it on example( https://github.com/liveforeverx/test_app ). Most elixir software, running in production is using exrm
under hood (self phoenix guideline have an section, how to run phoenix with exrm).
We can try to create the test_app and add exrm and tzdata to dependencies of our app.
Now, starting shell iex -S mix
, we get it manually (Tzdata.DataLoader.download_new()
) and what we see is:
test_app % ls
README.md _build/ config/ deps/ lib/ mix.exs mix.lock priv/ test/
We get new priv directory in our app, now, I show the most confusion, that other can get:
test_app % mix release
rel/test_app/bin/test_app console
iex([email protected])1> Tzdata.DataLoader.download_new()
And after, we download it, that is the structure
ls
bin/ erts-7.0/ lib/ log/ priv/ releases/ running-config/
test_app/rel/test_app % find . -name "priv"
./lib/asn1-4.0/priv
./lib/crypto-3.6/priv
./lib/hackney-1.3.2/priv
./lib/test_app-0.0.1/priv
./lib/tzdata-0.5.4/priv
./priv
Every production release structure will be damaged with an priv
directory on place, which is not means to be used for. That is a problem, with priv
on CWD, which will simply creating on very different locations the priv
directory.
Next problem is questionable, but good to think about(as I do not have answer for it). If we try for security reasons to split executable data location(where apps, beams are located) with mutable data locations(where for example database files located), which is requirement on most enterprise servers, which I know (May be I know, not so much).
If release directory shouldn't be changable, for example, if we make the whole rel/test_app
directory immutable(read only), than the application can't download the tmp data and overwrite the tzdata.
That means 2 consequences:
- priv shouldn't contain mutable data
- mutable data location should be configure, too (that means, that to accept requirement of splitting executable and data locations, we need to save ets and tmp on configured locations, instead of locations, where executable is placed ).
Can follow me?
from tzdata.
Let's say there is a custom location for mutable tzdata files. For instance config :tzdata, :data_dir, "/var/tzdata"
In this example /var/tzdata
is writable by the release. Tzdata will then use that instead of the default priv
dir. It can write files there. That's what I meant by having an alternative dir instead of priv. That should solve the problems, right?
from tzdata.
Yes
from tzdata.
@liveforeverx I have released a new version (0.5.5) where the data directory can be specified in a config file.
from tzdata.
Related Issues (20)
- Argument Error on :ets.lookup in ReleaseReader
- UndefinedFunctionError or wrong gap when date-time hits exactly the start of a gap HOT 1
- Tzdata polling for update HOT 9
- Function to list possible offsets for a time zone HOT 1
- Question: why were the functions related to `zone1970.tab` data removed (module `TableData`)? HOT 4
- Ability to download fresh tz release during build HOT 3
- Erlang 23 HTTPC support - update Hackney to ~> 1.16 HOT 2
- IANA data does not seem to be correctly parsed for America/Whitehorse (Canada/Yukon) and America/Dawson HOT 5
- Compiler warnings on Elixir 1.11.0
- Possible to force HTTP client Hackney
- Invalid gap for the first naive datetime in the gap range
- tzdata_current_release raise an argument error
- Method to convert an alias to a canonical zone? HOT 1
- Dropping hackney dependency HOT 10
- Tzdata 2.0 plans HOT 4
- Update to calendar version 2022g
- tzdata without timezone upon boot: (with time zone database Tzdata.TimeZoneDatabase), reason: :time_zone_not_found HOT 2
- state of this library
- Possible edge case around last rule applicable for a zone lines last year HOT 4
- Mainteners
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 tzdata.