-
Notifications
You must be signed in to change notification settings - Fork 0
Running the Application
What is the point of sharing a repo if nobody else can test or use the work you are sharing.
While the documentation is still quite a bit rusty I hope that this page will allow you to follow along while there are no packages. This should allow local testing of Ranger as well as any of the extensions I have built in the repo.
Most of the Docker components will have an image in docker hub that I will attempt to keep updated however if there are issues please raise an issue in the repo
There are 2 Guides, building using Docker/Docker Compose & building from source (currently a little bit involved)
Both of these guides assume you are on a Unix system and can run a curl
command. Both (but more so the second) expects you to be comfortable with the CLI and have an IDE (I recommend VS Code)
To follow along and test the features in this repo you will need the following:
- Docker Installed with docker-compose enabled (I think this is always by default now?)
- Git
- Active Internet connection (for pulling images)
- Clone the Repo
git clone https://github.com/Spydernaz/ranger-sample-app.git
- Enter the repository
cd ranger-sample-app
- Run the docker-compose
docker-compose up --build
The current demo has a hardcoded policy implemented for the
/hello
route. To test, run the following command:curl localhost:8080/helloYou should receive the following message
Unauthorized: 403!
but after the following steps, you should be able to configure a policy such that the response will beHello World!
- Go to ranger-admin
- Login to the UI
admin
:passw0rd
- Create the new HTTPService interface
curl -u admin:passw0rd -X POST -H "Accept: application/json" -H "Content-Type: application/json" --data @./docker/http_plugin/service_def_http.json http://localhost:6080/service/plugins/definitions
- Add a new httpservice instance (click the plus on the ranger http service)
- If you are using the default application, then the name should be
helloworldapp
- Enter a URL (won't matter at the moment, open issue #9)
- Add the service
- Add a test policy by clicking the helloworldapp service > Add a Policy
- Enter a Policy Name for the policy and use the HTTP Path /hello
- Configure the user to be Admin and have the permission get and save the policy
- Run
curl localhost:8080/hello
. You should get the responseHello World!
// TODO