Skip to content

Commit

Permalink
Merge pull request #845 from hashtopolis/feature/apiv2
Browse files Browse the repository at this point in the history
Initial POC for split user interface and new API
  • Loading branch information
s3inlc authored Jun 9, 2023
2 parents 13907ee + f38be29 commit 46a8c26
Show file tree
Hide file tree
Showing 177 changed files with 8,429 additions and 691 deletions.
12 changes: 12 additions & 0 deletions .devcontainer/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
DEV_CONTAINER_USER_CMD_PRE='cat > /usr/local/share/ca-certificates/corporate_ca.crt << EOF
-----BEGIN CERTIFICATE-----
<<< INSERT_PEM_FORMATTED_ROOT_CA_CHAIN_HERE >>>
-----END CERTIFICATE-----
EOF
update-ca-certificates --fresh
echo "openssl.cafile=/etc/ssl/certs/ca-certificates.crt" > /usr/local/etc/php/conf.d/corporate-cert.ini
mkdir -p /usr/etc/

# NPM repository cache example
echo "registry=https://nexus.example.com/repository/npm-all/" > /usr/etc/npmrc
'
65 changes: 0 additions & 65 deletions .devcontainer/Dockerfile

This file was deleted.

47 changes: 0 additions & 47 deletions .devcontainer/adduser.php

This file was deleted.

74 changes: 51 additions & 23 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,58 @@
{
"name": "Hashtopolis Devcontainer",
"dockerComposeFile": "docker-compose.yml",
"service": "hashtopolis",
"runServices": ["db"],

"appPort": [8080],

"service": "hashtopolis-server",
"runServices": [
"db"
],
"appPort": [
8080
],
"workspaceMount": "src=${localWorkspaceFolder},dst=/var/www/html,type=bind,consistency=cached",
"workspaceFolder": "/var/www/html",

"extensions": [
"xdebug.php-debug",
"bmewburn.vscode-intelephense-client",
"editorconfig.editorconfig",
],
"remoteEnv": {
"NODE_OPTIONS": "--use-openssl-ca",
},
"remoteUser": "vscode",
"settings": {
"terminal.integrated.profiles.linux":{
"bash": {
"path": "bash",
"icon": "terminal-bash"
"customizations": {
"vscode": {
"extensions": [
"xdebug.php-debug",
"bmewburn.vscode-intelephense-client",
"editorconfig.editorconfig",
"github.vscode-pull-request-github",
"ms-python.python",
"mtxr.sqltools",
"mtxr.sqltools-driver-mysql"
],
"settings": {
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash",
"icon": "terminal-bash",
"args": [
"--init-file",
"${workspaceFolder}/init.sh"
]
}
},
"terminal.integrated.defaultProfile.linux": "bash",
"sqltools.connections": [
{
"mysqlOptions": {
"authProtocol": "default"
},
"previewLimit": 50,
"server": "db",
"port": 3306,
"driver": "MySQL",
"username": "root",
"password": "hashtopolis",
"name": "DevcontainerDB",
"database": "hashtopolis"
}
]
}
},
"terminal.integrated.defaultProfile.linux": "bash",
}
},
"remoteEnv": {
"NODE_OPTIONS": "--use-openssl-ca"
},
}
"remoteUser": "vscode"
}
29 changes: 12 additions & 17 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
version: "3.5"
version: "3.7"
services:
hashtopolis:
container_name: hashtopolis
hashtopolis-server:
container_name: hashtopolis-server
build:
context: .
dockerfile: Dockerfile
context: ..
target: hashtopolis-server-dev
args:
- DEV_CONTAINER_USER_CMD_PRE
- DEV_CONTAINER_USER_CMD_POST
- CONTAINER_USER_CMD_PRE
- CONTAINER_USER_CMD_POST
environment:
HASHTOPOLIS_DB_USER: hashtopolis
HASHTOPOLIS_DB_PASS: hashtopolis
HASHTOPOLIS_DB_HOST: db
HASHTOPOLIS_DB_DATABASE: hashtopolis
depends_on:
- db
ports:
Expand All @@ -31,16 +36,6 @@ services:
MYSQL_DATABASE: hashtopolis
MYSQL_USER: hashtopolis
MYSQL_PASSWORD: hashtopolis
cap_drop:
- ALL
cap_add:
# used to change files since non-priv user
- CHOWN
# used because container uses find command
- CAP_DAC_READ_SEARCH
# used for the gosu binary
- CAP_SETGID
- CAP_SETUID
networks:
- hashtopolis_dev
volumes:
Expand Down
58 changes: 0 additions & 58 deletions .devcontainer/docker-entrypoint.sh

This file was deleted.

4 changes: 4 additions & 0 deletions .devcontainer/sites-enabled/000-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
DocumentRoot /var/www/html/src
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

<Directory /var/www/html/src/api/v2>
AllowOverride All
</Directory>
</VirtualHost>
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ data/conf.php
src/import/*
.gitignore
.dockerignore
src/inc/conf.php
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,15 @@ src/files/*
*.phpproj.user
*.lock

# dynamically created by installer
src/install/.htaccess

# for docker stuff
.env

# for composer stuff
vendor

# For python cache files
__pycache__
.pytest_cache
12 changes: 10 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"version": "0.2.0",

"configurations": [

{
"name": "Listen for Xdebug",
"type": "php",
Expand Down Expand Up @@ -47,7 +46,9 @@
"-dxdebug.mode=debug",
"-dxdebug.start_with_request=yes",
"-S",
"localhost:0"
"localhost:0",
"-t",
"src"
],
"program": "",
"cwd": "${workspaceRoot}",
Expand All @@ -57,6 +58,13 @@
"uriFormat": "http://localhost:%s",
"action": "openExternally"
}
},
{
"name": "Python: File",
"type": "python",
"request": "launch",
"program": "${file}",
"justMyCode": true
}
],
"inputs": [
Expand Down
14 changes: 14 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"python.testing.unittestArgs": [
"-v",
"-s",
"./ci",
"-p",
"test_*.py"
],
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.pytestArgs": [
"ci"
]
}
Loading

0 comments on commit 46a8c26

Please sign in to comment.