Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a standardized folder to store user data (Docker) #3633

Open
agneevX opened this issue Sep 20, 2021 · 8 comments
Open

Use a standardized folder to store user data (Docker) #3633

agneevX opened this issue Sep 20, 2021 · 8 comments
Labels

Comments

@agneevX
Copy link
Contributor

agneevX commented Sep 20, 2021

Problem Description

AGH currently uses two folders to store its data: /opt/adguardhome/conf that stores the lone configuration file and /opt/adguardhome/work that stores the remaining user data including databases and filters text files.

This file structure feels very convoluted, because there are multiple folders and a muddy hierarchy. The presence of a "work" folder feels particularly redundant.

❯ tree /opt/appdata/adguardhome/
/
├── config
│   └── AdGuardHome.yaml
└── workdir
    ├── data
    │   ├── filters
    │   │   ├── 1.txt.old
    │   │   ├── 1620456986.txt
...
    │   │   └── 740910348
    │   ├── sessions.db
    │   └── stats.db
    └── leases.db

4 directories, 59 files

Proposed Solution

A singular /config folder that stores user data in a single folder with a less confusing hierarchy, including databases in the root (not inside another data folder).

This same could be used for non-Docker installations as well, just /opt/adguardhome/.

Alternatives Considered

Additional Information

I'd also request the use of better file names to denote their purpose, e.g. sessions.dbweb_sessions.db.

@ainar-g
Copy link
Contributor

ainar-g commented Sep 21, 2021

I'm not sure if we want to do that. See this comment. In short, the configuration directory is for files that the user provides or maintains, while the working (aka data) directory is for the persistent files that AGH creates and that are not guaranteed to be human-readable.

@agneevX
Copy link
Contributor Author

agneevX commented Sep 21, 2021

For Docker installs, it doesn't make sense for the current folders to exist. Why use /opt at all?

@ainar-g
Copy link
Contributor

ainar-g commented Sep 22, 2021

I don't quite get your question, sorry. If you want to ask, why do we expect these volumes to be mounted as subdirectories of /opt/adguardhome, then it's because /opt subdirectories are the usual place where third-party software not packaged with the OS and not built from source goes. See man hier and also this answer.

@agneevX
Copy link
Contributor Author

agneevX commented Sep 22, 2021

I meant to say that in Docker installs, there's the flexibility of choosing folders that doesn't have to be the same as a bare metal install.

E.g. /app could be used to house the binary executable, while
/config and /data can store the configuration file and the remaining user data.

@almereyda
Copy link

It's okay to have two volume mounts in a containerised environment.

It further seems okay to follow a "classical", POSIX oriented file system layout, if deployment as a container is not the primary and/or only target for software distribution. In cloud-native world, of course, things are oftentimes handled a little differently, governed by these systems' constraints.

@stale stale bot added the wontfix label Mar 30, 2022
@agneevX
Copy link
Contributor Author

agneevX commented Mar 30, 2022

Begone bot.

@stale stale bot removed the wontfix label Mar 30, 2022
@stale stale bot added the wontfix label Jul 10, 2022
@agneevX
Copy link
Contributor Author

agneevX commented Jul 11, 2022

@ainar-g can this bot situation please be dealt with?

@stale stale bot removed the wontfix label Jul 11, 2022
@cyb3rz3us
Copy link

IMHO, this proposal appears to be one based on personal preference and not anything grounded in either BCP or building a better product. Having 2 dedicated directories is not convoluted at all and in the xNIX world, this is not only common, but in the particular case of AGH, quite tame.

I believe an old but very appropo adage applies here: "If it ain't broke, don't go fixin' it".

@AdguardTeam AdguardTeam deleted a comment from stale bot Aug 29, 2022
@AdguardTeam AdguardTeam deleted a comment from stale bot Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants