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

Integrate with Gitpod #539

Draft
wants to merge 34 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8a1b7f5
added nextcloud, mariadb and phpmyadmin
JonathanTreffler Jul 19, 2021
f54c558
started implementation of simplesamlserver and ldap server
JonathanTreffler Jul 19, 2021
b542d99
modified simplesamlserver Dockerfile
JonathanTreffler Jul 19, 2021
a9d2eee
fixed compatibility with mariadb 10.6.3 (latest)
JonathanTreffler Jul 19, 2021
3e6bdd7
generated proper certificates
JonathanTreffler Jul 19, 2021
9f3d2b1
continued implementation of simplesamlserver
JonathanTreffler Jul 22, 2021
87b7c69
fixed gettext apt install
JonathanTreffler Jul 22, 2021
cee30c7
implemented nextcloud url insertion for simplesamlphp server config
JonathanTreffler Jul 22, 2021
5b68970
fixed duplicate slashes in paths substituted by env vars
JonathanTreffler Jul 22, 2021
e0dcb62
improved url env setup
JonathanTreffler Jul 22, 2021
fac744f
first try to fix unnecessary substitution in template
JonathanTreffler Jul 22, 2021
1b7aa89
fixing expire error
JonathanTreffler Jul 22, 2021
c504e9b
fixed invalid issuer in assertion issue
JonathanTreffler Jul 22, 2021
774aa83
enabled debug in nextcloud config
JonathanTreffler Jul 22, 2021
21110bc
fixed debug config
JonathanTreffler Jul 22, 2021
ab1f405
removed debug config function (not working)
JonathanTreffler Jul 22, 2021
75609cd
implemented debug config differently and fixed missing table issue
JonathanTreffler Jul 23, 2021
55d6d5d
removed old comment
JonathanTreffler Jul 23, 2021
00fb65a
improved after_install.sh
JonathanTreffler Jul 23, 2021
d4970a8
added docker vs code extension
JonathanTreffler Jul 23, 2021
40b19e7
cleaned up gitpod config
JonathanTreffler Jul 23, 2021
471cb91
added email mapping to database prepopulate
JonathanTreffler Jul 23, 2021
80d72cd
added gitpod README
JonathanTreffler Jul 23, 2021
bf9dd50
added xdebug to nextcloud dockerfile
JonathanTreffler Jul 23, 2021
60da068
cleaned up config files
JonathanTreffler Jul 23, 2021
6b0b23e
deleted login test from simplesamlphp
JonathanTreffler Jul 23, 2021
d673d6a
fixed xdebug install
JonathanTreffler Jul 23, 2021
60dccd8
continued xdebug integration
JonathanTreffler Jul 23, 2021
6e22237
fixed docker version 20 install
JonathanTreffler Jul 23, 2021
a881d5a
continued implementing xdebug
JonathanTreffler Jul 23, 2021
587b2b1
migrated nextcloud docker to network mode host
JonathanTreffler Jul 23, 2021
5208265
removed docker version 20 installation
JonathanTreffler Jul 23, 2021
55dd49d
moved back to bridge networking
JonathanTreffler Jul 23, 2021
a6d4a58
Update README.md
JonathanTreffler Aug 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
3rdparty/vendor/onelogin/php-saml/endpoints/

build

gitpod/mariadb/prepopulate.sql
gitpod/simplesamlphp/var-simplesamlphp/metadata/saml20-sp-remote.php
47 changes: 47 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

github:
prebuilds:
master: true
branches: true
pullRequests: true
pullRequestsFromForks: true
addCheck: true
addComment: false
addBadge: true

tasks:
- name: Nextcloud Server
command: |
git config core.fileMode false
chmod -R 777 .
cd gitpod
export SIMPLESAML_URL=$(gp url 8082)/simplesaml
export NEXTCLOUD_URL=$(gp url 8080)
export HOSTIP=$(ip -4 addr show scope global dev eth0 | grep inet | awk '{print $2}' | cut -d / -f 1 | sed -n 1p)

curl -L https://github.com/a8m/envsubst/releases/download/v1.2.0/envsubst-`uname -s`-`uname -m` -o envsubst
chmod +x envsubst
sudo mv envsubst /usr/local/bin

envsubst < mariadb/prepopulate.sql.template > mariadb/prepopulate.sql
envsubst < simplesamlphp/var-simplesamlphp/metadata/saml20-sp-remote.php.template > simplesamlphp/var-simplesamlphp/metadata/saml20-sp-remote.php
docker-compose up

- name: Terminal
command: clear

ports:
- port: 8080
onOpen: open-browser
visibility: private
- port: 8081
visibility: private
onOpen: ignore
- port: 8082
visibility: private
onOpen: ignore

vscode:
extensions:
- ms-azuretools.vscode-docker
- felixfbecker.php-debug
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003
},
]
}
56 changes: 56 additions & 0 deletions gitpod/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Try it on Gitpod
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/[user]/[repository/)

It will automatically spin up and configure a full Nextcloud, MariaDB, PhpMyAdmin, SimpleSAMLphp and 389 Directory development server.

## Usage
- Open the Repository in gitpod
- Wait about 4 minutes for all servers to start (progress can be followed in the Nextcloud Terminal)
- If your browser doesn't block it, a new tab with the Nextcloud server opens automatically.
- If not go to the Remote Explorer Tab and open port 8080

## Ports
- 8080: Nextcloud
- 8081: PhpMyAdmin
- 8082: SimpleSAMLphp Admin (/simplesaml subdirectory)

## Nextcloud Direct Login:
**URL:** [https://8080-[Workspace Name].gitpod.io/login?direct=1]()

**Username:** dev

**Password:** t2qQ1C6ktYUv7

## Nextcloud Saml Login:
### 1
**Username:** test1

**Password:** test1password

### 2
**Username:** test2

**Password:** test2password

### 3
**Username:** bender

**Password:** bender

## PhpMyAdmin Login:
**Username:** nextcloud

**Password:** wdGq73jQB0p373gLdf6yLRj5

(It is fine to have these static logins, because gitpod has acess control built in and no sensitive data is stored in these dev servers)

## SimpleSAMLphp Admin Login:
**Username:** admin

**Password:** 1234

# OCC Acess
You can acess nextclouds occ shell using this command:
```
docker exec -it -u 33 gitpod_app_1 php occ
````
75 changes: 75 additions & 0 deletions gitpod/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# This is for gitpod, DO NOT USE THIS TO HOST YOUR PRODUCTION NEXTCLOUD

version: '2'

volumes:
nextcloud:
db:
config:

services:
db:
image: mariadb
restart: always
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb_read_only_compressed=OFF
volumes:
- db:/var/lib/mysql
- ./mariadb:/docker-entrypoint-initdb.d
environment:
- MYSQL_ROOT_PASSWORD=wdGq73jQB0p373gLdf6yLRj5
- MYSQL_PASSWORD=wdGq73jQB0p373gLdf6yLRj5
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud

phpmyadmin:
image: phpmyadmin
container_name: pma
links:
- db
environment:
PMA_HOST: db
PMA_PORT: 3306
restart: always
ports:
- 8081:80

app:
image: nextcloud
build:
context: ./nextcloud
dockerfile: Dockerfile
restart: always
ports:
- 8080:80
links:
- db
volumes:
- nextcloud:/var/www/html
- config:/var/www/html/config
- ${GITPOD_REPO_ROOT}:/var/www/html/custom_apps/user_saml
environment:
- MYSQL_PASSWORD=wdGq73jQB0p373gLdf6yLRj5
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db
- NEXTCLOUD_ADMIN_USER=dev
- NEXTCLOUD_ADMIN_PASSWORD=t2qQ1C6ktYUv7
- NEXTCLOUD_TRUSTED_DOMAINS=*.gitpod.io
- OVERWRITEPROTOCOL=https
- NEXTCLOUD_UPDATE=1
extra_hosts:
- host:${HOSTIP}

simplesamlphp:
build:
context: ./simplesamlphp/
dockerfile: Dockerfile
restart: always
ports:
- 8082:80
environment:
- SIMPLESAML_URL
- NEXTCLOUD_URL

ldap:
build: ./ldap/
27 changes: 27 additions & 0 deletions gitpod/ldap/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM centos:centos7

RUN yum install -y epel-release \
&& yum update -y \
&& yum install -y 389-ds-base 389-adminutil \
&& yum clean all

COPY ds-setup.inf /ds-setup.inf
COPY users.ldif /users.ldif

# The 389-ds setup will fail because the hostname can't reliable be determined, so we'll bypass it and then install.
RUN useradd ldapadmin \
&& rm -fr /var/lock /usr/lib/systemd/system \
# The 389-ds setup will fail because the hostname can't reliable be determined, so we'll bypass it and then install. \
&& sed -i 's/checkHostname {/checkHostname {\nreturn();/g' /usr/lib64/dirsrv/perl/DSUtil.pm \
# Not doing SELinux \
&& sed -i 's/updateSelinuxPolicy($inf);//g' /usr/lib64/dirsrv/perl/* \
# Do not restart at the end \
&& sed -i '/if (@errs = startServer($inf))/,/}/d' /usr/lib64/dirsrv/perl/* \
&& setup-ds.pl --silent --file /ds-setup.inf \
&& /usr/sbin/ns-slapd -D /etc/dirsrv/slapd-dir \
&& while ! curl -s ldap://localhost:389 > /dev/null; do echo waiting for ldap to start; sleep 1; done; \
ldapadd -H ldap:/// -f /users.ldif -x -D "cn=Directory Manager" -w password

EXPOSE 389

CMD /usr/sbin/ns-slapd -D /etc/dirsrv/slapd-dir && tail -F /var/log/dirsrv/slapd-dir/access
21 changes: 21 additions & 0 deletions gitpod/ldap/ds-setup.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[General]
AdminDomain = user_saml_gitpod
ConfigDirectoryAdminID = admin
ConfigDirectoryAdminPwd = admin
ConfigDirectoryLdapURL = ldap://localhost:389/o=NetscapeRoot
FullMachineName = localhost
ServerRoot = /usr/lib64/dirsrv
SuiteSpotGroup = nobody
SuiteSpotUserID = nobody

[slapd]
AddOrgEntries = Yes
AddSampleEntries = No
InstallLdifFile = suggest
RootDN = cn=Directory Manager
RootDNPwd = password
ServerIdentifier = dir
ServerPort = 389
SlapdConfigForMC = yes
Suffix = dc=user_saml_gitpod
UseExistingMC = No
47 changes: 47 additions & 0 deletions gitpod/ldap/users.ldif
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
dn: cn=admin,dc=user_saml_gitpod
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
userPassword: password
description: LDAP administrator


dn: uid=test1,ou=People,dc=user_saml_gitpod
objectClass: organizationalPerson
objectClass: person
objectClass: top
objectClass: inetOrgPerson
givenName: Test
uid: test1
sn: Person 1
cn: test person 1
mail: [email protected]/
userPassword: test1password

dn: uid=test2,ou=People,dc=user_saml_gitpod
objectClass: organizationalPerson
objectClass: person
objectClass: top
objectClass: inetOrgPerson
givenName: Test
uid: test2
sn: Person 2
cn: test person 2
mail: [email protected]/
userPassword: test2password

dn: cn=Bender Bending Rodriguez,ou=People,dc=user_saml_gitpod
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
cn: Bender Bending Rodriguez
description: Robot
displayName: Bender
employeeType: Ship's Robot
givenName: Bender
mail: [email protected]
ou: People
uid: bender
userPassword: bender
sn: Rodriguez
39 changes: 39 additions & 0 deletions gitpod/mariadb/prepopulate.sql.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

CREATE TABLE `oc_appconfig` (
`appid` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT '',
`configkey` varchar(64) COLLATE utf8mb4_bin NOT NULL DEFAULT '',
`configvalue` longtext COLLATE utf8mb4_bin DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPRESSED;

INSERT INTO `oc_appconfig` (`appid`, `configkey`, `configvalue`) VALUES
('user_saml', 'enabled', 'yes'),
('user_saml', 'general-idp0_display_name', ''),
('user_saml', 'general-uid_mapping', 'urn:oid:0.9.2342.19200300.100.1.1'),
('user_saml', 'idp-entityId', '$SIMPLESAML_URL/saml2/idp/metadata.php'),
('user_saml', 'idp-singleLogoutService.url', '${SIMPLESAML_URL}/saml2/idp/SingleLogoutService.php'),
('user_saml', 'idp-singleSignOnService.url', '$SIMPLESAML_URL/saml2/idp/SSOService.php'),
('user_saml', 'idp-x509cert', '-----BEGIN CERTIFICATE-----\nMIIEazCCAtOgAwIBAgIUVe3Ml/fwjyN00L5CrJGDT9FKHU0wDQYJKoZIhvcNAQEL\nBQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM\nGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMTA3MTkxMTM2MzNaFw0zMTA3\nMTkxMTM2MzNaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw\nHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggGiMA0GCSqGSIb3DQEB\nAQUAA4IBjwAwggGKAoIBgQDGxIo6wrrtHLYLLgVRne1cMjN3RdsSHZ18mvDF4Kov\nzqTS9jpP1qxWfAyC064Zk4S0sYXc2DCsjTEsibRb7LNBJpPDbzlAtavgsMS3H1v8\nTbYEW0tkTOGQR+HfFzvmprG8km28KFmYo4k3Ik092D12ff3sSEp7HifGQIz1k46G\n6Ac/kMiSVtaRn0JMWb9Z21T8rpntlI6/anDWgNjxjn9e38HmC4Thix6fr7u015ZP\nu26oAuA5PzJHju8mH6b+XY2jVNpUWg8YgmPX3bPWIbrVz82G7aGeFYodl+vn49dt\nUPH1k3bKWWU6vRgRXeXrQHZtMirDC3Nn008V+N5544jAjz3DatfRgYOux7zLQtBU\nb4XsFR8GLMxuCoqvX3TtcL73veOehio4eLEBikfM6MGpORxVMazzkcjQuQjqnA3n\nfCx8nMH7X+rbJFs7RzijZvIMkgwIYU2X/Lawaphj2cIBeFZdbmO7pJO0UTyhRc0u\nHMMvWRL6hAvxS9sxYyavn9ECAwEAAaNTMFEwHQYDVR0OBBYEFJvQolHQnd/B69q6\nTrnMMpkpkHmwMB8GA1UdIwQYMBaAFJvQolHQnd/B69q6TrnMMpkpkHmwMA8GA1Ud\nEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggGBADPs7uLp6wq1WOasxPSWTjvZ\nmdAuHep/+SlwII4hC3N/eaxgj3jS8N/EJve5nWEGRDBFvdIwizRTkXnX2IO8cqYE\n4qd9LMsi+0ONoDzh/CUeHjzRr/XX8rSw9fjGgfPQr2CWLG9IHAkj6mYUJf7dmULY\nnntiDvxGpow1WHUaihSIWj0Vni40V6S5YgW1WQwf5/Cz/CVUkUcO6ndtWBcc4Sl/\ntHVhFS/+Qefd/tf0Ms1TcgQBMRK6niDs7qW3snMy9M2hMJGhF2dqJD5iGHezeJNT\n5hNs2+v46y5qaq8X2nDlCiFpHKP8Lv1lHlb18j1l+MP9s9g4J2oEHjQy+bGIQQC9\nNt7bYroJ7IXNZMW4BMSpfafblpS7uF910l8/T0R8zGssjgfznWFV+xHonfC+rquv\nUgbNzfFyxVxTD06u/INdIA3ZYOiIssxpUjGlnpatbPs2vPF9Cu4byvdQhxatRXGs\nnyQRRqSHj2nuRltsjoeTQrpGBoXmaRPYCoPThnK2EQ==\n-----END CERTIFICATE-----'),
('user_saml', 'installed_version', '4.2.0'),
('user_saml', 'saml-attribute-mapping-displayName_mapping', 'urn:oid:2.16.840.1.113730.3.1.241'),
('user_saml', 'saml-attribute-mapping-email_mapping', 'urn:oid:0.9.2342.19200300.100.1.3'),
('user_saml', 'sp-privateKey', '-----BEGIN PRIVATE KEY-----\nMIIG/gIBADANBgkqhkiG9w0BAQEFAASCBugwggbkAgEAAoIBgQC1YvuoUvLGdQcH\nUXh1IkeeyG3aTxJPORd19b7r6PJFnQIhLcvjSDKqeyMJJUbNG+s12fp3X4M70xCZ\nM8T+DuRg7r1CXXQjQbr3ubTz49Z063AQf0Ng0Lv8wTWtA/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DVR0OBBYEFA1R/XFcW/vjaocE\nepB+rx3QrQVaMB8GA1UdIwQYMBaAFA1R/XFcW/vjaocEepB+rx3QrQVaMA8GA1Ud\nEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggGBAEBS4NL8u3hN2O5oWzv2LsTA\nhdPaqGQI8935KDn36NAVRQ3J+b5K1aFPfNsMdCPI2YgT78QlgIPQ8HVz6bVt+Q7l\nk1BybxLgnvHwIxviFkOPtzdKcMgPYocMREg+NjYSa2d6tu5u1ySb8mhECJI+9hcU\nkCCeARK2tm8x+A2uvvnUy2+O4i2nDvqDbophEUv8EETM+Gb9M+7kQ2hOLD7jwdm7\n5yBLNmAkVLALLpYS5rONJlSXzkJ+kQ/XxrOxfIf/QT+CvmeQ/FG6Hp/UBtbmPxKe\n928J5ZZ8dlGAdP2M7nX06aNM8lFSow/dCScF+VaUYSSEoGB3xpxZKdorVNpSBODj\nxN++2WeXpuN8mHaFMjM5MrcNnZ8P6xrPhlfsrbm4IFIJfxJxnQrzoqs+LogfPL30\n/C8UStRbrz4ljZ+Tq99DJQb+XtoCSGvlxvIsKjvx6IT1BRUCt0RJ5gHIv+7rds8X\nLKbQ2aXzQTav4+NxahMYyy/n4WMgwdC0s8I0D+xwQw==\n-----END CERTIFICATE-----'),
('user_saml', 'type', 'saml'),
('user_saml', 'types', 'authentication');

ALTER TABLE `oc_appconfig`
ADD PRIMARY KEY (`appid`,`configkey`),
ADD KEY `appconfig_config_key_index` (`configkey`);
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
17 changes: 17 additions & 0 deletions gitpod/nextcloud/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM nextcloud

RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_host=host" >> /usr/local/etc/php/conf.d/xdebug.ini

COPY custom-entrypoint.sh /custom-entrypoint.sh
COPY after-install.sh /after-install.sh

RUN chmod +x /custom-entrypoint.sh
RUN chmod +x /after-install.sh

ENTRYPOINT ["/custom-entrypoint.sh"]

CMD ["/after-install.sh"]
20 changes: 20 additions & 0 deletions gitpod/nextcloud/after-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

run_as() {
if [ "$(id -u)" = 0 ]; then
su -p www-data -s /bin/sh -c "$1"
else
sh -c "$1"
fi
}

run_as "php /var/www/html/occ config:system:set debug --value='true' --type=boolean"

# Weirdly the Nextcloud docker activates user_saml app automatically but doesn't run the migration steps necessary for it to work
run_as "php /var/www/html/occ migrations:migrate user_saml"

run_as "php /var/www/html/occ app:disable firstrunwizard"

run_as "php /var/www/html/occ config:system:set defaultapp --value='files'"

apache2-foreground
11 changes: 11 additions & 0 deletions gitpod/nextcloud/custom-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

# Both gitpod and Nextcloud need read/write acess
# Obviously not recommended for a production system
chmod -R 777 /var/www/html/custom_apps/

# mv /debug.config.php /var/www/html/config

# chmod -R 777 /var/www/html/config

/entrypoint.sh "$@"
6 changes: 6 additions & 0 deletions gitpod/simplesamlphp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM unicon/simplesamlphp

COPY var-simplesamlphp /var/simplesamlphp/

RUN chown apache:apache /var/simplesamlphp/log/ \
&& chown -R apache:apache /var/simplesamlphp/cert/
Loading