HEX
Server: Apache
System: Linux vpshost11508.publiccloud.com.br 5.15.179-grsec-vpshost-10.lc.el8.x86_64 #1 SMP Mon Apr 7 12:04:45 -03 2025 x86_64
User: wicomm2 (10002)
PHP: 8.3.0
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //usr/bin/lwdbprovd
#!/usr/libexec/platform-python
# -*- coding: utf-8 -*-
import logging
import logging.handlers
import logging.config
import yaml
import os

from lwdbadmin import bottle
from lwdbadmin.bottle import request
from lwdbadmin.api import error, auth

with open('/opt/lc/lwdbadmin/etc/lwdbadmin-log.yml', 'r') as f:
    configlog = yaml.safe_load(f.read())

logging.config.dictConfig(configlog)
logger = logging.getLogger(__name__)

app = application = bottle.Bottle()
app.error_handler = error.handler
app.install(auth.authorize)
DESC_PATH = '/etc/default/locaweb/description'

if os.path.exists('%s/mysql' % DESC_PATH):
    logger.info("Loading Mysql Endpoint")
    from lwdbadmin.api import mysql
    app.merge(mysql.app)

if os.path.exists('%s/postgresql' % DESC_PATH):
    logger.info("Loading PostgreSQL Endpoint")
    from lwdbadmin.api import pgsql
    app.merge(pgsql.app)

class StripPathMiddleware(object):
    def __init__(self, a):
        self.a = a
    def __call__(self, e, h):
        e['PATH_INFO'] = e['PATH_INFO'].rstrip('/')
        return self.a(e, h)

def main():
    bottle.debug(True)
    logger.info("Starting lwdbadmin service")

    bottle.run(app    = StripPathMiddleware(app),
               server = 'auto',
               host   = '0.0.0.0',
               port   = 8080)

if __name__ == '__main__':
    main()