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

Adminer #2662

Closed
piwi82 opened this issue Feb 13, 2017 · 3 comments · Fixed by #3894
Closed

Adminer #2662

piwi82 opened this issue Feb 13, 2017 · 3 comments · Fixed by #3894

Comments

@piwi82
Copy link
Contributor

piwi82 commented Feb 13, 2017

This issue is linked to the #2661 issue.

Official website : http://adminer.org
Official source : https://github.com/vrana/adminer/

Dependencies : Web Station and MariaDB.

Security considerations :

  • Restrict access to local networks (10/8, 127/8, 172.16/12, 192.168/16) using a .htaccess file.

PostgreSQL considerations :

  • I had to comment the block if (extension_loaded("pgsql")) { ... } in pgsql.inc.php because the extension pgsql does not work with the PostgreSQL server from DSM. The Extension pdo_pgsql works perfectly.
  • Some extra setup should be done to grant access to PostgreSQL databases, but this will only concern advanced users. PostgreSQL uses system user accounts, so only the right privileges have to be set for the Web Station user account (http) :
login as: admin
admin@DiskStation’s password: ************
admin@DiskStation:~$ sudo -i
Password: ************
root@DiskStation:~# su - postgres
postgres@DiskStation:~$ psql
psql (9.3.6)
Type “help” for help.
 

postgres=# \du
                                     List of roles
        Role name          |                   Attributes                   | Member of
----------------------------+------------------------------------------------+-----------
postgres                   | Superuser, Create role, Create DB, Replication | {}
 

postgres=# GRANT CONNECT ON DATABASE my_db TO http;
postgres=# GRANT
postgres=# \connect my_db
You are now connected to database "my_db" as user "postgres".
postgres=# GRANT SELECT ON TABLE my_table TO http;
GRANT
postgres=# \q
@Dr-Bean
Copy link
Contributor

Dr-Bean commented Feb 13, 2017

👍

The .htaccess file is already done, right? https://github.com/SynoCommunity/spksrc/blob/master/cross/adminer/Makefile#L28? Does that still work as intended on DSM6?

As for the postgreSQL connection, document it in a wiki, like here? I assume this should never be made part of the package by default.

For the dependencies, I think adding this file should work: https://github.com/SynoCommunity/spksrc/blob/master/spk/cops/src/conf/PKG_DEPS. That file is missing MariaDB as a dependency, but you could argue that it doesn't need to be a dependency for adminer.

@piwi82
Copy link
Contributor Author

piwi82 commented Feb 14, 2017

Yes, it works on DSM 6.0.2-8451u9.

I wouldn't like to provide a package that gives full access to the PostgreSQL database (weird things could append between a keyboard and a chair...). But if some packages require a pgSQL DB, we will be able to provide an access using the package user account. Good idea to document it in the wiki.

Adminer is compatible with any DSM version, it's a simple PHP script. We shouldn't restrict its use to DSM 6.

If adminer is used with PostgreSQL, MariaDB is no more a dependency. So the only dependency is Web Station.

@piwi82
Copy link
Contributor Author

piwi82 commented Feb 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

2 participants